#include<bits/stdc++.h>
using namespace std;

int a[100010], w[100010];

int main(){

    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);

    int n;

    cin >> n;

    for(int i = 1; i <= n; i ++){

        cin >> a[i];

    }

    sort(a + 1, a + 1 + n);

    w[1] = 0;

    for(int i = 1; i <= n; i ++){

        if(a[i] == a[i - 1]){

            w[i] = w[i - 1];

        }else{

            w[i] = i - 1;

        }

    }

    int cnt = 0;

    for(int i = 2; i <= n; i ++){



        if(w[i] != 0){

            cnt ++;

        }

        cnt = min(cnt, w[i]);
        if(w[i] != 0){

            w[i] --;

        }

    }

    cout << n - cnt;

    return 0;

}
